<?php
/**
*
* @package shopBB
* @copyright (c) 2008 EXreaction, Lithium Studios
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* Generate Storage Options
*/
function generate_storage_options($disable_bbcode, $disable_smilies, $disable_magic_url)
{
	$allow_bbcode = (isset($_POST[$disable_bbcode])) ? 0 : OPTION_FLAG_BBCODE;
	$allow_smilies = (isset($_POST[$disable_smilies])) ? 0 : OPTION_FLAG_SMILIES;
	$enable_magic_url = (isset($_POST[$disable_magic_url])) ? 0 : OPTION_FLAG_LINKS;

	return $allow_bbcode + $allow_smilies + $enable_magic_url;
}

/**
* Reverse storage options
*/
function reverse_storage_options($options, &$enable_bbcode, &$enable_magic_url, &$enable_smilies)
{
	$enable_bbcode = ($options & OPTION_FLAG_BBCODE) ? 1 : 0;
	$enable_magic_url = ($options & OPTION_FLAG_LINKS) ? 1 : 0;
	$enable_smilies = ($options & OPTION_FLAG_SMILIES) ? 1 : 0;
}

?>